package day11;

public class TestError {
    public static void main(String[] args) {
        new TestError().a(9527);
    }

    public void a(int a) {
        try {
            // open connect database ...
            System.out.println(1/1);
            System.out.println("a end");
            // 有可能会出现N种异常
            // close();
        } catch (ArithmeticException | ArrayIndexOutOfBoundsException | NullPointerException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.getMessage();
        } finally {
            System.out.println("不论try的代码是否正常，finally都是一定执行的代码");
        }
        System.out.println("执行结束");
    }

}
